from django.conf import settings
from rest_framework.routers import DefaultRouter, SimpleRouter

import tsl_backend.users.api.views as user_views 
import tsl_backend.fgr_api.views.views as fgr_views 
# import tsl_backend.fgr_api.views.auth as fgr_auth_views 
import tsl_backend.frontend_api.views.order as frontend_order_views 
import tsl_backend.frontend_api.views.report as frontend_report_views 
import tsl_backend.frontend_api.views.printlabel as frontend_printlabel_views
import tsl_backend.frontend_api.views.uploadrt as frontend_uploadrt_views

if settings.DEBUG:
    router = DefaultRouter()
else:
    router = SimpleRouter()

# router.register("users", user_views.UserViewSet)
router.register("queryProdOrder", fgr_views.DetailViewSet)
router.register("queryActualBom", fgr_views.ActualBomModelViewSet)
router.register("updateProdWeight", fgr_views.ProdWeightViewSet, basename='updateProdWeight')
router.register("startWorkerFlow", fgr_views.StartWorkerFlowViewSet, basename='startWorkerFlow')
router.register("updatePrintStatus", fgr_views.PrintStatusViewSet, basename='updatePrintStatus')
router.register("updatePFStatus", fgr_views.PFStatusViewSet, basename='updatePFStatus')
router.register("queryOrderRoutingInfo", fgr_views.queryOrderRoutingInfo)
router.register("discardOrder", fgr_views.DiscardOrderView)

router.register("frontend/OrderView", frontend_order_views.OrderView, basename='OrderView')
router.register("frontend/OrderRoute", frontend_order_views.OrderRouteView, basename='OrderRouteView')
router.register("frontend/OrderOnHold", frontend_order_views.OrderOnHoldView)
router.register("frontend/WorkerAction", frontend_order_views.WorkerActionView)
router.register("frontend/QCActionView", frontend_order_views.QCActionView)

router.register("frontend/report/WorkerReportView", frontend_report_views.WorkerReportView, basename='WorkerReportView')
router.register("frontend/report/QCReportView", frontend_report_views.QCReportView, basename='QCReportView')
router.register("frontend/report/QCInventoryReportView", frontend_report_views.QCInventoryReportView, basename='QCInventoryReportView')
router.register("frontend/report/PrintStatusView", frontend_report_views.PrintStatusReportView, basename='PrintStatusReportView')
router.register("frontend/report/LeadTimeReportView", frontend_report_views.LeadTimeReportView, basename='LeadTimeReportView')

router.register("frontend/printer", frontend_printlabel_views.PrintLabelView, basename='PrintLabelView')
router.register("frontend/uploadRoutingTable", frontend_uploadrt_views.UploadRouteTableView, basename='UploadRouteTableView')
router.register("frontend/OutstandingMaster", frontend_uploadrt_views.OutstandingMasterView, basename='OutstandingMasterView')

app_name = "api"
urlpatterns = router.urls
